package com.fkdx.common.enums.sys;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public class GroupException extends RuntimeException {

    private int errCode;
    private String errMsg;

    public GroupException() {
        super();
        this.errCode = ErrCodeEnum.SERVER_ERROR.getErrCode();
        this.errMsg = ErrCodeEnum.SERVER_ERROR.getErrMsg();
    }

    public GroupException(String message) {
        super(message);
        this.errCode = ErrCodeEnum.SERVER_ERROR.getErrCode();
        this.errMsg = message;
    }

    public GroupException(String message, Throwable cause) {
        super(message, cause);
        this.errCode = ErrCodeEnum.SERVER_ERROR.getErrCode();
        this.errMsg = message;
    }

    protected GroupException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.errCode = ErrCodeEnum.SERVER_ERROR.getErrCode();
        this.errMsg = message;
    }

    public GroupException(ErrCodeEnum errCodeEnum) {
        this.errCode = errCodeEnum.getErrCode();
        this.errMsg = errCodeEnum.getErrMsg();
    }

}

